<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::PCDReader类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1_p_c_d_reader.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="classpcl_1_1_p_c_d_reader-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::PCDReader类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>Point <a class="el" href="class_cloud.html" title="A wrapper which allows to use any implementation of cloud provided by a third-party library.">Cloud</a> Data (PCD) file format reader.  
 <a href="classpcl_1_1_p_c_d_reader.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="pcd__io_8h_source.html">pcd_io.h</a>&gt;</code></p>
<div class="dynheader">
类 pcl::PCDReader 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classpcl_1_1_p_c_d_reader.png" usemap="#pcl::PCDReader_map" alt=""/>
  <map id="pcl::PCDReader_map" name="pcl::PCDReader_map">
<area href="classpcl_1_1_file_reader.html" title="Point Cloud Data (FILE) file format reader interface. Any (FILE) format file reader should implement ..." alt="pcl::FileReader" shape="rect" coords="0,0,102,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a8a4127b7dafb5e4015a665f4455f5f19"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <b>PCD_V6</b> = 0
, <b>PCD_V7</b> = 1
 }</td></tr>
<tr class="memdesc:a8a4127b7dafb5e4015a665f4455f5f19"><td class="mdescLeft">&#160;</td><td class="mdescRight">Various PCD file versions.  <a href="classpcl_1_1_p_c_d_reader.html#a8a4127b7dafb5e4015a665f4455f5f19">更多...</a><br /></td></tr>
<tr class="separator:a8a4127b7dafb5e4015a665f4455f5f19"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a30d526bb72cfb0e85d4bfd95e55ea950"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a30d526bb72cfb0e85d4bfd95e55ea950">PCDReader</a> ()</td></tr>
<tr class="separator:a30d526bb72cfb0e85d4bfd95e55ea950"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9da986913408efb40faaf5867b7cacca"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a9da986913408efb40faaf5867b7cacca">~PCDReader</a> ()</td></tr>
<tr class="separator:a9da986913408efb40faaf5867b7cacca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28f335288e9e23826d241ea3053bf076"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a28f335288e9e23826d241ea3053bf076">readHeader</a> (const std::string &amp;file_name, <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;cloud, Eigen::Vector4f &amp;origin, Eigen::Quaternionf &amp;orientation, int &amp;pcd_version, int &amp;data_type, unsigned int &amp;data_idx, const int offset=0)</td></tr>
<tr class="memdesc:a28f335288e9e23826d241ea3053bf076"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data header from a PCD file.  <a href="classpcl_1_1_p_c_d_reader.html#a28f335288e9e23826d241ea3053bf076">更多...</a><br /></td></tr>
<tr class="separator:a28f335288e9e23826d241ea3053bf076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7f0e72226fcd3b75b98d064ab2c63e2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#ad7f0e72226fcd3b75b98d064ab2c63e2">readHeader</a> (const std::string &amp;file_name, <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;cloud, const int offset=0)</td></tr>
<tr class="memdesc:ad7f0e72226fcd3b75b98d064ab2c63e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data header from a PCD file.  <a href="classpcl_1_1_p_c_d_reader.html#ad7f0e72226fcd3b75b98d064ab2c63e2">更多...</a><br /></td></tr>
<tr class="separator:ad7f0e72226fcd3b75b98d064ab2c63e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21f154e8ce3f4d5e905ecaa395935c42"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a21f154e8ce3f4d5e905ecaa395935c42">read</a> (const std::string &amp;file_name, <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;cloud, Eigen::Vector4f &amp;origin, Eigen::Quaternionf &amp;orientation, int &amp;pcd_version, const int offset=0)</td></tr>
<tr class="memdesc:a21f154e8ce3f4d5e905ecaa395935c42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data from a PCD file and store it into a pcl/PCLPointCloud2.  <a href="classpcl_1_1_p_c_d_reader.html#a21f154e8ce3f4d5e905ecaa395935c42">更多...</a><br /></td></tr>
<tr class="separator:a21f154e8ce3f4d5e905ecaa395935c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81f91dadebc44e618d3bea8178bc7698"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a81f91dadebc44e618d3bea8178bc7698">read</a> (const std::string &amp;file_name, <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;cloud, const int offset=0)</td></tr>
<tr class="memdesc:a81f91dadebc44e618d3bea8178bc7698"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data from a PCD (PCD_V6) and store it into a pcl/PCLPointCloud2.  <a href="classpcl_1_1_p_c_d_reader.html#a81f91dadebc44e618d3bea8178bc7698">更多...</a><br /></td></tr>
<tr class="separator:a81f91dadebc44e618d3bea8178bc7698"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a977a238557b3e1d5c9380d30ecba779a"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:a977a238557b3e1d5c9380d30ecba779a"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1_p_c_d_reader.html#a977a238557b3e1d5c9380d30ecba779a">read</a> (const std::string &amp;file_name, <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud, const int offset=0)</td></tr>
<tr class="memdesc:a977a238557b3e1d5c9380d30ecba779a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data from any PCD file, and convert it to the given template format.  <a href="classpcl_1_1_p_c_d_reader.html#a977a238557b3e1d5c9380d30ecba779a">更多...</a><br /></td></tr>
<tr class="separator:a977a238557b3e1d5c9380d30ecba779a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classpcl_1_1_file_reader"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classpcl_1_1_file_reader')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classpcl_1_1_file_reader.html">pcl::FileReader</a></td></tr>
<tr class="memitem:a94072e7c2380c4c1da3465c2b69af9f9 inherit pub_methods_classpcl_1_1_file_reader"><td class="memItemLeft" align="right" valign="top"><a id="a94072e7c2380c4c1da3465c2b69af9f9"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_file_reader.html#a94072e7c2380c4c1da3465c2b69af9f9">FileReader</a> ()</td></tr>
<tr class="memdesc:a94072e7c2380c4c1da3465c2b69af9f9 inherit pub_methods_classpcl_1_1_file_reader"><td class="mdescLeft">&#160;</td><td class="mdescRight">empty constructor <br /></td></tr>
<tr class="separator:a94072e7c2380c4c1da3465c2b69af9f9 inherit pub_methods_classpcl_1_1_file_reader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7edf7999f66456a8dff01ff2ac157513 inherit pub_methods_classpcl_1_1_file_reader"><td class="memItemLeft" align="right" valign="top"><a id="a7edf7999f66456a8dff01ff2ac157513"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_file_reader.html#a7edf7999f66456a8dff01ff2ac157513">~FileReader</a> ()</td></tr>
<tr class="memdesc:a7edf7999f66456a8dff01ff2ac157513 inherit pub_methods_classpcl_1_1_file_reader"><td class="mdescLeft">&#160;</td><td class="mdescRight">empty destructor <br /></td></tr>
<tr class="separator:a7edf7999f66456a8dff01ff2ac157513 inherit pub_methods_classpcl_1_1_file_reader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfa34c71c7f148557a5d3ab0517e1c29 inherit pub_methods_classpcl_1_1_file_reader"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1_file_reader.html#abfa34c71c7f148557a5d3ab0517e1c29">read</a> (const std::string &amp;file_name, <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;cloud, const int offset=0)</td></tr>
<tr class="memdesc:abfa34c71c7f148557a5d3ab0517e1c29 inherit pub_methods_classpcl_1_1_file_reader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data from a FILE file (FILE_V6 only!) and store it into a pcl/PCLPointCloud2.  <a href="classpcl_1_1_file_reader.html#abfa34c71c7f148557a5d3ab0517e1c29">更多...</a><br /></td></tr>
<tr class="separator:abfa34c71c7f148557a5d3ab0517e1c29 inherit pub_methods_classpcl_1_1_file_reader"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa38fa10dc5ca8f8a9b3e7c41f1cf36af inherit pub_methods_classpcl_1_1_file_reader"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:aa38fa10dc5ca8f8a9b3e7c41f1cf36af inherit pub_methods_classpcl_1_1_file_reader"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1_file_reader.html#aa38fa10dc5ca8f8a9b3e7c41f1cf36af">read</a> (const std::string &amp;file_name, <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud, const int offset=0)</td></tr>
<tr class="memdesc:aa38fa10dc5ca8f8a9b3e7c41f1cf36af inherit pub_methods_classpcl_1_1_file_reader"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point cloud data from any FILE file, and convert it to the given template format.  <a href="classpcl_1_1_file_reader.html#aa38fa10dc5ca8f8a9b3e7c41f1cf36af">更多...</a><br /></td></tr>
<tr class="separator:aa38fa10dc5ca8f8a9b3e7c41f1cf36af inherit pub_methods_classpcl_1_1_file_reader"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>Point <a class="el" href="class_cloud.html" title="A wrapper which allows to use any implementation of cloud provided by a third-party library.">Cloud</a> Data (PCD) file format reader. </p>
<dl class="section author"><dt>作者</dt><dd>Radu B. Rusu </dd></dl>
</div><h2 class="groupheader">成员枚举类型说明</h2>
<a id="a8a4127b7dafb5e4015a665f4455f5f19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a4127b7dafb5e4015a665f4455f5f19">&#9670;&nbsp;</a></span>anonymous enum</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Various PCD file versions. </p>
<p>PCD_V6 represents PCD files with version 0.6, which contain the following fields:</p><ul>
<li>lines beginning with # are treated as comments</li>
<li>FIELDS ...</li>
<li>SIZE ...</li>
<li>TYPE ...</li>
<li>COUNT ...</li>
<li>WIDTH ...</li>
<li>HEIGHT ...</li>
<li>POINTS ...</li>
<li>DATA ascii/binary</li>
</ul>
<p>Everything that follows <b>DATA</b> is intepreted as data points and will be read accordingly.</p>
<p>PCD_V7 represents PCD files with version 0.7 and has an important addon: it adds sensor origin/orientation (aka viewpoint) information to a dataset through the use of a new header field:</p><ul>
<li>VIEWPOINT tx ty tz qw qx qy qz </li>
</ul>
<div class="fragment"><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        PCD_V6 = 0,</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        PCD_V7 = 1</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      };</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">构造及析构函数说明</h2>
<a id="a30d526bb72cfb0e85d4bfd95e55ea950"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30d526bb72cfb0e85d4bfd95e55ea950">&#9670;&nbsp;</a></span>PCDReader()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">pcl::PCDReader::PCDReader </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Empty constructor </p>
<div class="fragment"><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;: <a class="code" href="classpcl_1_1_file_reader.html#a94072e7c2380c4c1da3465c2b69af9f9">FileReader</a> () {}</div>
<div class="ttc" id="aclasspcl_1_1_file_reader_html_a94072e7c2380c4c1da3465c2b69af9f9"><div class="ttname"><a href="classpcl_1_1_file_reader.html#a94072e7c2380c4c1da3465c2b69af9f9">pcl::FileReader::FileReader</a></div><div class="ttdeci">FileReader()</div><div class="ttdoc">empty constructor</div><div class="ttdef"><b>Definition:</b> file_io.h:60</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a9da986913408efb40faaf5867b7cacca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9da986913408efb40faaf5867b7cacca">&#9670;&nbsp;</a></span>~PCDReader()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">pcl::PCDReader::~PCDReader </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Empty destructor </p>
<div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;{}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a81f91dadebc44e618d3bea8178bc7698"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81f91dadebc44e618d3bea8178bc7698">&#9670;&nbsp;</a></span>read() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pcl::PCDReader::read </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a point cloud data from a PCD (PCD_V6) and store it into a pcl/PCLPointCloud2. </p>
<dl class="section note"><dt>注解</dt><dd>This function is provided for backwards compatibility only and it can only read PCD_V6 files correctly, as <a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> does not contain a sensor origin/orientation. Reading any file <blockquote class="doxtable">
<p>PCD_V6 will generate a warning. </p>
</blockquote>
</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td>the name of the file containing the actual <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> data </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud</td><td>the resultant <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> message read from disk </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>the offset of where to expect the PCD Header in the file (optional parameter). One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple PCD files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>&lt; 0 (-1) on error</li>
<li>== 0 on success </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a21f154e8ce3f4d5e905ecaa395935c42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a21f154e8ce3f4d5e905ecaa395935c42">&#9670;&nbsp;</a></span>read() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int pcl::PCDReader::read </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Vector4f &amp;&#160;</td>
          <td class="paramname"><em>origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Quaternionf &amp;&#160;</td>
          <td class="paramname"><em>orientation</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>pcd_version</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a point cloud data from a PCD file and store it into a pcl/PCLPointCloud2. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td>the name of the file containing the actual <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> data </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud</td><td>the resultant <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> message read from disk </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">origin</td><td>the sensor acquisition origin (only for &gt; PCD_V7 - null if not present) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">orientation</td><td>the sensor acquisition orientation (only for &gt; PCD_V7 - identity if not present) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pcd_version</td><td>the PCD version of the file (either PCD_V6 or PCD_V7) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>the offset of where to expect the PCD Header in the file (optional parameter). One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple PCD files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>&lt; 0 (-1) on error</li>
<li>== 0 on success </li>
</ul>
</dd></dl>

<p>实现了 <a class="el" href="classpcl_1_1_file_reader.html#a6c7b7ed00b43536739a8465064426c1b">pcl::FileReader</a>.</p>

</div>
</div>
<a id="a977a238557b3e1d5c9380d30ecba779a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a977a238557b3e1d5c9380d30ecba779a">&#9670;&nbsp;</a></span>read() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int pcl::PCDReader::read </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a point cloud data from any PCD file, and convert it to the given template format. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td>the name of the file containing the actual <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> data </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud</td><td>the resultant <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> message read from disk </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>the offset of where to expect the PCD Header in the file (optional parameter). One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple PCD files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>&lt; 0 (-1) on error</li>
<li>== 0 on success </li>
</ul>
</dd></dl>
<div class="fragment"><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;      {</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        <a class="code" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> blob;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keywordtype">int</span> pcd_version;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordtype">int</span> res = <a class="code" href="classpcl_1_1_p_c_d_reader.html#a21f154e8ce3f4d5e905ecaa395935c42">read</a> (file_name, blob, cloud.<a class="code" href="classpcl_1_1_point_cloud.html#aad7c2cd4b0d1c7f0fbc096276b5e2230">sensor_origin_</a>, cloud.<a class="code" href="classpcl_1_1_point_cloud.html#a5de17e88bdf15e1c4fd1bcc6b85b1941">sensor_orientation_</a>, </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                        pcd_version, offset);</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160; </div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        <span class="comment">// If no error, convert the data</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        <span class="keywordflow">if</span> (res == 0)</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;          pcl::fromPCLPointCloud2 (blob, cloud);</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        <span class="keywordflow">return</span> (res);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;      }</div>
<div class="ttc" id="aclasspcl_1_1_p_c_d_reader_html_a21f154e8ce3f4d5e905ecaa395935c42"><div class="ttname"><a href="classpcl_1_1_p_c_d_reader.html#a21f154e8ce3f4d5e905ecaa395935c42">pcl::PCDReader::read</a></div><div class="ttdeci">int read(const std::string &amp;file_name, pcl::PCLPointCloud2 &amp;cloud, Eigen::Vector4f &amp;origin, Eigen::Quaternionf &amp;orientation, int &amp;pcd_version, const int offset=0)</div><div class="ttdoc">Read a point cloud data from a PCD file and store it into a pcl/PCLPointCloud2.</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_a5de17e88bdf15e1c4fd1bcc6b85b1941"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#a5de17e88bdf15e1c4fd1bcc6b85b1941">pcl::PointCloud::sensor_orientation_</a></div><div class="ttdeci">Eigen::Quaternionf sensor_orientation_</div><div class="ttdoc">Sensor acquisition pose (rotation).</div><div class="ttdef"><b>Definition:</b> point_cloud.h:423</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_aad7c2cd4b0d1c7f0fbc096276b5e2230"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#aad7c2cd4b0d1c7f0fbc096276b5e2230">pcl::PointCloud::sensor_origin_</a></div><div class="ttdeci">Eigen::Vector4f sensor_origin_</div><div class="ttdoc">Sensor acquisition pose (origin/translation).</div><div class="ttdef"><b>Definition:</b> point_cloud.h:421</div></div>
<div class="ttc" id="astructpcl_1_1_p_c_l_point_cloud2_html"><div class="ttname"><a href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a></div><div class="ttdef"><b>Definition:</b> PCLPointCloud2.h:21</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ad7f0e72226fcd3b75b98d064ab2c63e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad7f0e72226fcd3b75b98d064ab2c63e2">&#9670;&nbsp;</a></span>readHeader() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pcl::PCDReader::readHeader </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a point cloud data header from a PCD file. </p>
<p>Load only the meta information (number of points, their types, etc), and not the points themselves, from a given PCD file. Useful for fast evaluation of the underlying data structure.</p>
<dl class="section attention"><dt>注意</dt><dd>The PCD data is <b>always</b> stored in ROW major format! The read/write PCD methods will detect column major input and automatically convert it.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td>the name of the file to load </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud</td><td>the resultant point cloud dataset (only the header will be filled) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>the offset of where to expect the PCD Header in the file (optional parameter). One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple PCD files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>&lt; 0 (-1) on error</li>
<li>== 0 on success </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a28f335288e9e23826d241ea3053bf076"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28f335288e9e23826d241ea3053bf076">&#9670;&nbsp;</a></span>readHeader() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int pcl::PCDReader::readHeader </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structpcl_1_1_p_c_l_point_cloud2.html">pcl::PCLPointCloud2</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Vector4f &amp;&#160;</td>
          <td class="paramname"><em>origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Eigen::Quaternionf &amp;&#160;</td>
          <td class="paramname"><em>orientation</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>pcd_version</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"><em>data_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int &amp;&#160;</td>
          <td class="paramname"><em>data_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>offset</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a point cloud data header from a PCD file. </p>
<p>Load only the meta information (number of points, their types, etc), and not the points themselves, from a given PCD file. Useful for fast evaluation of the underlying data structure.</p>
<dl class="section attention"><dt>注意</dt><dd>The PCD data is <b>always</b> stored in ROW major format! The read/write PCD methods will detect column major input and automatically convert it.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_name</td><td>the name of the file to load </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud</td><td>the resultant point cloud dataset (only the header will be filled) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">origin</td><td>the sensor acquisition origin (only for &gt; PCD_V7 - null if not present) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">orientation</td><td>the sensor acquisition orientation (only for &gt; PCD_V7 - identity if not present) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">pcd_version</td><td>the PCD version of the file (i.e., PCD_V6, PCD_V7) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data_type</td><td>the type of data (0 = ASCII, 1 = Binary, 2 = Binary compressed) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data_idx</td><td>the offset of cloud data within the file </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>the offset of where to expect the PCD Header in the file (optional parameter). One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple PCD files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>&lt; 0 (-1) on error</li>
<li>== 0 on success </li>
</ul>
</dd></dl>

<p>实现了 <a class="el" href="classpcl_1_1_file_reader.html#ae51784cb6db39877b912df20377eaef1">pcl::FileReader</a>.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>io/include/pcl/io/<a class="el" href="pcd__io_8h_source.html">pcd_io.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><a class="el" href="classpcl_1_1_p_c_d_reader.html">PCDReader</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
